package lanQiaoBei.基础算法.位运算;

import java.io.*;

/*
 * 求一个数x的二进制位有几个1
 * */
public class P2 {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static int x;

    public static void scan() throws Exception {
        x = Integer.parseInt(br.readLine());
    }


    static int lowbit(int x){
           return x & -x;
    }
    public static void main(String[] args) throws Exception {
        scan();
        int res=0;
        while(x>0){
             int t=lowbit(x);
             x-=t;
             res++;
        }
        System.out.print(res);
    }
}
